list1 = [1, 2, 3, 4, 5]
for i in range(len(list1)):
    print(list1[i], end=" ")
print()
print('----------------------------')
list1.append(6)
print(list1)

for i in list1:
    print(i, end=" ")
print()
print('----------------------------')

list2 = [8, 9]
list1.extend(list2)
print(list1)
print(list2)

list1.insert(2, 67)
print(list1)

list1.sort()  # 默认升序
print(list1)
list1.reverse()  # 降序(反转)
print(list1)
list1.sort(reverse=True)
print(list1)

list3 = [12, 22, 33, 44, 6, 8, 3]
list4 = sorted(list3)
print(list3)
print(list4)

num = list4.pop()
print(num)
print(list4)

list5 = [1, 2, 3, 4, 5, 5]
del list5[2]  # 下标
print(list5)
list5.remove(5)  # 值
print(list5)
list5.clear()
print(list5)

strtype = ("python",)
strtype1 = ("python")
print(type(strtype))
print(type(strtype1))

set1 = {1, 2, 3, 4, 5}  # 集合无序
print(set1)

dict1 = {"name": "zhangsan", "age": 18}
dict1["sex"] = "male"  # 添加
dict1["age"] = 19  # 修改
for key, value in dict1.items():
    print(key, value)

print(dict1.keys())
print(dict1.values())
print(dict1.items())
